package com.fly.hello.web;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

@Api(tags = "TXT验证")
@RestController
public class TxtController
{
    String response;
    
    @ApiOperation("设置")
    @ApiOperationSupport(order = 10)
    @PostMapping("/txt/set")
    public String set(String result)
    {
        this.response = result;
        return response;
    }
    
    @ApiOperation("验证")
    @ApiOperationSupport(order = 20)
    @GetMapping("/{path}.txt")
    public String index(@PathVariable String path)
    {
        return response;
    }
}